package com.example.controller;

import com.example.entity.training.TrainingPlan;
import com.example.service.TrainingPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("api/training")
public class TrainingPlanController {

    @Autowired
    TrainingPlanService trainingPlanService;

    @RequestMapping(value = "/query", method = RequestMethod.POST)
    public Map<String,Object> query(@RequestBody TrainingPlan trainingPlan){
        return trainingPlanService.query(trainingPlan);
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public Map<String,Object> add(@RequestBody TrainingPlan trainingPlan){
        return trainingPlanService.add(trainingPlan);
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public Map<String,Object> update(@RequestBody Map map){
        return trainingPlanService.update(map);
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public Map<String,Object> delete(@RequestBody Map map){
        return trainingPlanService.delete(map);
    }

    @RequestMapping(value = "/uploadMaterials", method = RequestMethod.POST)
    public Map<String,Object> uploadMaterials(@RequestBody TrainingPlan trainingPlan){
        return trainingPlanService.uploadMaterials(trainingPlan);
    }

    @RequestMapping(value = "/uploadCheckInTable", method = RequestMethod.POST)
    public Map<String,Object> uploadCheckInTable(@RequestBody TrainingPlan trainingPlan){
        return trainingPlanService.uploadCheckInTable(trainingPlan);
    }

    @RequestMapping(value = "/uploadTestPaper", method = RequestMethod.POST)
    public Map<String,Object> uploadTestPaper(@RequestBody TrainingPlan trainingPlan){
        return trainingPlanService.uploadTestPaper(trainingPlan);
    }

    @RequestMapping(value = "/uploadSummaryStatement", method = RequestMethod.POST)
    public Map<String,Object> uploadSummaryStatement(@RequestBody TrainingPlan trainingPlan){
        return trainingPlanService.uploadSummaryStatement(trainingPlan);
    }

}
